<?php
	session_start();
	require_once("../includes/public.inc.php");
	require_once("delete_qiandao.php");
	$openid = "oYqwzuFX-ue9vd9Ws8d1cl3xEo90";
	if($openid)
	{
		$user = mysql_fetch_assoc(mysql_query("select * from ".DBQIAN."users where openid='".$openid."' order by id desc limit 1"));
		$_SESSION['userinfo']=$user;
		if (isset($_SESSION['openid']))
		{
			
		}
		else 
		{
			$_SESSION['openid'] = $openid;
		}
// 		var_dump($_SESSION['userinfo']);exit;
	}
	else
	{
		echo "<script>alert('非法进入，请检查提交的数据是否正确!!');</script>";exit;
	}
?>
<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,user-scalable=no,maximum-scale=1,initial-scale=1">
<title>个人中心</title>
<link type="text/css" href="css/css.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="css/sweet-alert.css">
<script src="js/sweet-alert.min.js"></script>
<script src="js/jquery-1.9.0.min.js"></script>
<script>
$(document).ready(function(){
	$("#qiandao").click(function(){
		$.get("ajax.php?openid=<?=$openid?>",function(data){
			if (data == 'success')
			{
				swal("签到", "成功", "success");
				self.location.reload();
			}
			else if (data == 'done')
			{
				swal("今天已签到", "", "error");
			}
			else
			{
				swal("签到", "失败", "error");
			}
		});
	});
});
</script>
</head>
<body>
<ul class="top-tool" style="top:0px; left:0px">
	<span class="back"><a href="javascript:history.go(-1)"><img src="./image/back_icon.png" width="33px"></a></span>
	<span class="title">个人中心</span>
	<span class="home"><a href=""><img src="./image/zy_icon.png"></a></span>
</ul>
<div style="height:50px"></div>
<div id="xq" class="pz-panel" style="margin-top:10px;">
	<ul class="navs">
	<li><img src="<?=$user['headimg_url']?>" alt="头像"><p>您好：&nbsp;<?=$user['name']?></p></li>
	<li class="center"><img src="./image/jf_icon.png"><p>我的积分：&nbsp;<?=$user['credit']?></p></li>
	<li><a href="javascript:void(0);" id="qiandao"><img src="./image/qd_icon.png"><p>签到</p></a></li>
	</ul>
</div>
<div id="xq" class="pz-panel" style="margin-top:38px;margin-bottom:120px;">
	<ul class="nav-content">
		<li><a href="hblog.php"><img src="./image/log_icon.png" alt="红包记录" title="红包记录"><span>红包记录</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="submit_withdrawal.php"><img src="./image/log_icon.png" alt="我要提现" title="我要提现"><span>我要提现</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="cashlog.php"><img src="./image/log_icon.png" alt="提现记录" title="提现记录"><span>提现记录</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="sendlog.php"><img src="./image/log_icon.png" alt="发放记录" title="发放记录"><span>发放记录</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="buylog.php"><img src="./image/log_icon.png" alt="购买记录" title="购买记录"><span>购买记录</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="signlog.php"><img src="./image/log_icon.png" alt="签到记录" title="签到记录"><span>签到记录</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="send_wait.php"><img src="./image/log_icon.png" alt="待发货" title="待发货"><span>待发货</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="arrive_wait.php"><img src="./image/log_icon.png" alt="待收货" title="待收货"><span>待收货</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="arrive.php"><img src="./image/log_icon.png" alt="已收货" title="已收货"><span>已收货</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="pay_wait.php"><img src="./image/log_icon.png" alt="待付款" title="待付款"><span>待付款</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="payed.php"><img src="./image/log_icon.png" alt="已付款" title="已付款"><span>已付款</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
		<li><a href="payed.php"><img src="./image/log_icon.png" alt="返佣管理" title="返佣管理"><span>返佣管理</span><span style="float:right;margin-right:12px;margin-top:13px;font-weight:bold;">>></span></a></li>
	</ul>
</div>
<div class="footer-tool">
	<div style="padding:0px;position:relative;margin:8px 6px;">
	    <ul class="nav">
		    <li onClick="location.href='hblog.php'"><img src="./image/hb_icon.png"><p>红包</p></li>
		    <li onClick="location.href='cashlog.php'"><img src="./image/tx_icon.png"><p>提现</p></li>
		    <li onClick="location.href='productshow.php'"><img src="./image/cp_icon.png"><p>产品</p></li>
		    <li style="border-right:none" onClick="location.href='person.php'">
		       <img src="./image/gr_icon.png">
		       <p>我的</p>
		    </li>
	    </ul>
	    <div style="clear:left">
	    </div>
	</div>
</div>
</body>
</html>